package csc.segmentation;

import csc.triangulation.Vector3d;
import java.util.ArrayList;
import java.util.List;

/**
 * Stack for storing voxels coordinates.
 * @author Stanislau Dubrouski
 */
public class SeedsStack {

    List<Vector3d> seeds;

    public SeedsStack() {
        seeds = new ArrayList<Vector3d>();
    }

    /**
     * Adds seed to stack.
     * @param seed 
     */
    public void push(Vector3d seed) {
        seeds.add(seed);
    }

    /**
     * Returns last added seed and removes it from stack.
     * @return last added seed.
     */
    public Vector3d pop() {
        Vector3d v = seeds.get(seeds.size() - 1);
        seeds.remove(v);
        return v;
    }

    /**
     * Checks stack for emptyness.
     * @return true if stack is empty.
     */
    public boolean isEmpty(){
        return seeds.isEmpty();
    }
}